#qsub the 
#!/bin/bash
source ~/.bashrc
source isFileEmpty.sh
if [ "$#" -lt 4 ]; then
    echo "This shell qsub a job to call runEnumIPerMTranSEQ.sh"
    echo ",which enumerates isoforms and their expressed levels"
    echo "in a given region."
	echo "The 1st ptr is chr seq name"
	echo "The 2nd ptr is the range start"
	echo "The 3st ptr is the range end"
	echo "The 4st ptr is gene name"
	echo "4 ptrs are needed"
	echo "There are $# ptrs"
	exit
fi
echo "#!/bin/csh" > $4.sh
{
	echo "#PBS -l walltime=4:00:00"
	echo "#PBS -l mem=4g"
	echo "#PBS -l pmem=4g"
	echo "#PBS -l nodes=1:ppn=4"
	echo "#PBS -l file=15g"
	echo "#PBS -q cmb"
	echo "cd $PWD"
	#echo "source ~/.bashrc"
	echo "~/SHELL/runEnumIPerMTranSEQ.sh $4 $1 $2 $3"
} >> $4.sh
qsub ./$4.sh
#echo "runEnumIPerMTranSEQ.sh $4 $1 $2 $3"
#~/SHELL/runEnumIPerMTranSEQ.sh $4 $1 $2 $3
\rm $4.sh



